#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
#include <stack>
#include <bitset>
#define F first
#define S second
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;

int ask(int x,int y)
{
	cout <<"? " << x <<" "<<y <<"\n";
	int ans;
	cin >> ans;
	return ans;
}
void solve()
{
	int n,m;
	cin>>n>>m;
	
	int a,b,c;
	a=ask(1,1);
	int x,y;
	if(a+1>n)
	{
		y=a+1;
		c=ask(1,y);
		x=1+c;
	}
	else if(a+1>m)
	{
		x=a+1;
		c=ask(x,1);
		y=1+c;
	}
	else
	{
		b=ask(a+1,1);
		c=ask(1,a+1);
		x=c+1;
		y=b+1;
	}
	cout<<"! "<<x<<' '<<y<<endl;
}
int main()
{
//	IOS;
	int T=1;
	cin>>T;

	while(T--) 
	{
		solve();
	}

	return 0;
}

